package com.blog.basic.dao;

import com.blog.basic.query.BasicQuery;
import com.blog.entity.Article;
import com.blog.entity.Category;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: blog
 * @description: 公共持久层接口
 * @author: Mr.zhao
 * @create: 2022-04-05 19:53
 **/
public interface BasicDao<T> {


    /**
    * @Description: 查询所有
    * @Param:
    * @return:
    * @Author: Mr.Zhao
    * @Date: 2022/4/5
    */
    List<T> selectAll();
    /**
    * @Description: 根据id删除
    * @Param:
    * @return:
    * @Author: Mr.Zhao
    * @Date: 2022/4/5
    */
    void deleteById(Integer id);
    /**
    * @Description: 根据id查询单个
    * @Param:
    * @return:
    * @Author: Mr.Zhao
    * @Date: 2022/4/5
    */
    T selectById(Integer id);

    /**
    * @Description: 添加
    * @Param:
    * @return:
    * @Author: Mr.Zhao
    * @Date: 2022/4/5
    */
    void save(T t);

    /**
    * @Description: 修改
    * @Param:
    * @return:
    * @Author: Mr.Zhao
    * @Date: 2022/4/5
    */
    void update(T t);

    /**
     * @Description: 所有
     * @Param:
     * @return:
     * @Author: Mr.Zhao
     * @Date: 2022/4/5
     */
    List<T> getbBasicQuery(BasicQuery basicQuery);

    /**
     * @Description: 总数
     * @Param:
     * @return:
     * @Author: Mr.Zhao
     * @Date: 2022/4/5
     */
    Integer getTotals(BasicQuery basicQuery);

}
